/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


package javaapplication1;

import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.widgets.Canvas;



/**
 *
 * @author Oren
 */
public class RV1 extends BasicRobot{
String localType = "RV1";
 public RV1(String name){
  super.speedLimit=10;
  super.headingLimit=20;

 }
 public RV1(){
  super.speedLimit=10;
  super.headingLimit=20;
 }
  public void setType(String type)
    {
        localType = type.concat(" "+localType);

    }
  public String getType()
 {
     
     return localType;
 }
   public void paint(PaintEvent e){
	Canvas c=(Canvas)e.widget;	// get the canvas
        // make a general function ?
        int maxX = c.getSize().x;	// max size
	int maxY = c.getSize().y;
	int mx=maxX/2,my=maxY/2;	// mid point as (0,0)
	int myX = mx + super.getCurrentPosition().x;	// set the current position
	int myY = my - super.getCurrentPosition().y;	// set the current position


	super.paint(e);
	e.gc.drawString(getType(),myX+13, myY,true);

}

}
